{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "authorship_tag": "ABX9TyNLwcA7kmIVPrsxLvuNsQmo",
      "include_colab_link": true
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU",
    "gpuClass": "standard",
    "widgets": {
      "application/vnd.jupyter.widget-state+json": {
        "26027cc52efb4feca46aa1a01733dd4b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_d897b42b3b5b459d9ff687639183b552",
              "IPY_MODEL_bf43e1f0f4ba431fa014fd806ab2ad45",
              "IPY_MODEL_2504de0eb9334ffc9f1355ce7ee64818"
            ],
            "layout": "IPY_MODEL_7911d4111ef64aecb1e5183f992c265a"
          }
        },
        "d897b42b3b5b459d9ff687639183b552": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_7b87d03d51b34ad9a294759759bb2f99",
            "placeholder": "​",
            "style": "IPY_MODEL_95d199b642ed4283bdd862482221c0ad",
            "value": "Downloading builder script: 100%"
          }
        },
        "bf43e1f0f4ba431fa014fd806ab2ad45": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_fb6fd341e4a247a7be15f991f6de1a68",
            "max": 4852,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_f4c3210b551c4abfa39097e649370705",
            "value": 4852
          }
        },
        "2504de0eb9334ffc9f1355ce7ee64818": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_a5fe90782b384126ad81ba1b6749f9ea",
            "placeholder": "​",
            "style": "IPY_MODEL_bcbec24e8f404d6bb3b6c2369a38e65f",
            "value": " 4.85k/4.85k [00:00&lt;00:00, 141kB/s]"
          }
        },
        "7911d4111ef64aecb1e5183f992c265a": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "7b87d03d51b34ad9a294759759bb2f99": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "95d199b642ed4283bdd862482221c0ad": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "fb6fd341e4a247a7be15f991f6de1a68": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "f4c3210b551c4abfa39097e649370705": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "a5fe90782b384126ad81ba1b6749f9ea": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "bcbec24e8f404d6bb3b6c2369a38e65f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "5c627e87f7494df3b5f4dd03dfefc418": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_e0c00ec80bda4a6a82bff73f90d030c7",
              "IPY_MODEL_6e64fb08e62245aba542f8b0620867bd",
              "IPY_MODEL_db7fd605466f46389f08fce3c9f9e8cc"
            ],
            "layout": "IPY_MODEL_6de6872a78094986ad307d3e92b993c9"
          }
        },
        "e0c00ec80bda4a6a82bff73f90d030c7": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_72a924a38b064482a45e6117f5d131c6",
            "placeholder": "​",
            "style": "IPY_MODEL_ee4166e279334e38bcf43bcaf181a5ec",
            "value": "Downloading data: 100%"
          }
        },
        "6e64fb08e62245aba542f8b0620867bd": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_d41c282ebce14abda7708029c72e7c21",
            "max": 16838830,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_2efe04a43816414da96074a4ff28523f",
            "value": 16838830
          }
        },
        "db7fd605466f46389f08fce3c9f9e8cc": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_e406f248c67545288dcc510f9b0238aa",
            "placeholder": "​",
            "style": "IPY_MODEL_3ae8c110c7d14457aa849784dbf968ed",
            "value": " 16.8M/16.8M [00:00&lt;00:00, 35.7MB/s]"
          }
        },
        "6de6872a78094986ad307d3e92b993c9": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "72a924a38b064482a45e6117f5d131c6": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "ee4166e279334e38bcf43bcaf181a5ec": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "d41c282ebce14abda7708029c72e7c21": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "2efe04a43816414da96074a4ff28523f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "e406f248c67545288dcc510f9b0238aa": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "3ae8c110c7d14457aa849784dbf968ed": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "1aa4e61ec0ee45f4ba937833a51716e7": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_9b7f7bcfcbe04f0d8e147cec9d9252ea",
              "IPY_MODEL_0b230cb2cc5549f6a00eda91602aea02",
              "IPY_MODEL_2cb6623348e749cf9c22e0f7e541cc9a"
            ],
            "layout": "IPY_MODEL_1b6efff4d94b47daa8cf9056ebf6881e"
          }
        },
        "9b7f7bcfcbe04f0d8e147cec9d9252ea": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_6cfb973d68784a9eb95855fcfc7fafef",
            "placeholder": "​",
            "style": "IPY_MODEL_fdf041057e904896a1d8e502840145b0",
            "value": "Generating train split: "
          }
        },
        "0b230cb2cc5549f6a00eda91602aea02": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "info",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_cba93c8e650848a9a642f00d472b6765",
            "max": 1,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_6b27dce746f94f78978ed0fea4afd8a1",
            "value": 1
          }
        },
        "2cb6623348e749cf9c22e0f7e541cc9a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_8c058e72c1c8459f8800b713c1324ac2",
            "placeholder": "​",
            "style": "IPY_MODEL_6204a3bbdfed46b2ba37b8aac9d1f600",
            "value": " 149/0 [00:28&lt;00:00,  9.89 examples/s]"
          }
        },
        "1b6efff4d94b47daa8cf9056ebf6881e": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": "hidden",
            "width": null
          }
        },
        "6cfb973d68784a9eb95855fcfc7fafef": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "fdf041057e904896a1d8e502840145b0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "cba93c8e650848a9a642f00d472b6765": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": "20px"
          }
        },
        "6b27dce746f94f78978ed0fea4afd8a1": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "8c058e72c1c8459f8800b713c1324ac2": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "6204a3bbdfed46b2ba37b8aac9d1f600": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "61b6c665bcc64b33a6428fbdd837ec7a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_9abcec8061eb42209466455128baa4c0",
              "IPY_MODEL_12f2250e8dae4bac9b94703d5a5a7a0e",
              "IPY_MODEL_8ee8a7a78a7c4abcbf4cb5bd099a827c"
            ],
            "layout": "IPY_MODEL_00ba5d048c6b41d2b4a539ac0760d644"
          }
        },
        "9abcec8061eb42209466455128baa4c0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_1ab8396aacf5486793308b4bcd8f97e5",
            "placeholder": "​",
            "style": "IPY_MODEL_3e4547993edb45bfa150ca845c4dfdc1",
            "value": "Generating test split: "
          }
        },
        "12f2250e8dae4bac9b94703d5a5a7a0e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "info",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_2f772e889f2a41dab88f79c7735c8aab",
            "max": 1,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_114e1ac91d864d448fb09ae4a34dded5",
            "value": 1
          }
        },
        "8ee8a7a78a7c4abcbf4cb5bd099a827c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_b6f720ab46604a62bc7d720cb18749c8",
            "placeholder": "​",
            "style": "IPY_MODEL_537eb09f486d4bb688a1d2fdbff7d4fe",
            "value": " 50/0 [00:04&lt;00:00,  8.96 examples/s]"
          }
        },
        "00ba5d048c6b41d2b4a539ac0760d644": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": "hidden",
            "width": null
          }
        },
        "1ab8396aacf5486793308b4bcd8f97e5": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "3e4547993edb45bfa150ca845c4dfdc1": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "2f772e889f2a41dab88f79c7735c8aab": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": "20px"
          }
        },
        "114e1ac91d864d448fb09ae4a34dded5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "b6f720ab46604a62bc7d720cb18749c8": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "537eb09f486d4bb688a1d2fdbff7d4fe": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "aafd329e9da9494997783c62e3cd048c": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_da8b7055a7504078800ead5184677f95",
              "IPY_MODEL_374f00dd5e6a454ca6f18691da6ea645",
              "IPY_MODEL_d6ddbfe8779b46eaa10be5827de80224"
            ],
            "layout": "IPY_MODEL_39d5a93e941a498e82520de590d16524"
          }
        },
        "da8b7055a7504078800ead5184677f95": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_b85426c0f15a448f8271b4402f276236",
            "placeholder": "​",
            "style": "IPY_MODEL_0f54316b16ba43d8bfa3881321fa85f2",
            "value": "100%"
          }
        },
        "374f00dd5e6a454ca6f18691da6ea645": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_61a2203f68cf4700a774e5f14bbcdc72",
            "max": 2,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_72b29a8a04aa4e9fae4c80f165a8c3c4",
            "value": 2
          }
        },
        "d6ddbfe8779b46eaa10be5827de80224": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_7f686c6833e346db89c16038bcb21667",
            "placeholder": "​",
            "style": "IPY_MODEL_baffb4a1f4f446e4881c057e5526ffaf",
            "value": " 2/2 [00:00&lt;00:00, 24.09it/s]"
          }
        },
        "39d5a93e941a498e82520de590d16524": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "b85426c0f15a448f8271b4402f276236": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "0f54316b16ba43d8bfa3881321fa85f2": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "61a2203f68cf4700a774e5f14bbcdc72": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "72b29a8a04aa4e9fae4c80f165a8c3c4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "7f686c6833e346db89c16038bcb21667": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "baffb4a1f4f446e4881c057e5526ffaf": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "161f6492fc9a4b5b8dcb6b60d30075e8": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_9825f686be2d452b9d06b9f70311b261",
              "IPY_MODEL_f4ea6e3e24f44f6e8d57793761a7a0da",
              "IPY_MODEL_a658ee8508d346b6898717068a0da9ea"
            ],
            "layout": "IPY_MODEL_e5e95dfd23b4469b80a1155b83517289"
          }
        },
        "9825f686be2d452b9d06b9f70311b261": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_69770719773a4de7860c7e8b248a48ca",
            "placeholder": "​",
            "style": "IPY_MODEL_60925aec159443f5bbfeeded44c3376b",
            "value": "Downloading: 100%"
          }
        },
        "f4ea6e3e24f44f6e8d57793761a7a0da": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_e27da60124204337ba49a056967a6705",
            "max": 451,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_8f8b573548a34f8595ac0addebc04bc7",
            "value": 451
          }
        },
        "a658ee8508d346b6898717068a0da9ea": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_f639a3cc02d34370ac548e6c770051d7",
            "placeholder": "​",
            "style": "IPY_MODEL_2782209b9140456ca6b39cde121936e5",
            "value": " 451/451 [00:00&lt;00:00, 13.7kB/s]"
          }
        },
        "e5e95dfd23b4469b80a1155b83517289": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "69770719773a4de7860c7e8b248a48ca": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "60925aec159443f5bbfeeded44c3376b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "e27da60124204337ba49a056967a6705": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "8f8b573548a34f8595ac0addebc04bc7": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "f639a3cc02d34370ac548e6c770051d7": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "2782209b9140456ca6b39cde121936e5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "705d9ca2025146cf841435ca3b8d725b": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_1aab71f014c945ac8f3ec865c0f90653",
              "IPY_MODEL_b7635b079d2044308a883cdc48339a34",
              "IPY_MODEL_86574ef4f6ab49e3a7bae77674e45062"
            ],
            "layout": "IPY_MODEL_d849196f8f08429e91158b442fcc99d3"
          }
        },
        "1aab71f014c945ac8f3ec865c0f90653": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_6a60593b74fb46e8899a05ca0f703615",
            "placeholder": "​",
            "style": "IPY_MODEL_1f9870a33ba24530ba3c8efebe93ef2f",
            "value": "Downloading: 100%"
          }
        },
        "b7635b079d2044308a883cdc48339a34": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_500ef74c2b4246199a7e28bf97eeda74",
            "max": 17082660,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_a68f9736f07f4d1e96ed3388ead89cf5",
            "value": 17082660
          }
        },
        "86574ef4f6ab49e3a7bae77674e45062": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_20c6cfdd855c4e26b53798d475771f0a",
            "placeholder": "​",
            "style": "IPY_MODEL_08428693c6da4b31aed698696d5c382e",
            "value": " 17.1M/17.1M [00:00&lt;00:00, 34.0MB/s]"
          }
        },
        "d849196f8f08429e91158b442fcc99d3": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "6a60593b74fb46e8899a05ca0f703615": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "1f9870a33ba24530ba3c8efebe93ef2f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "500ef74c2b4246199a7e28bf97eeda74": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "a68f9736f07f4d1e96ed3388ead89cf5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "20c6cfdd855c4e26b53798d475771f0a": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "08428693c6da4b31aed698696d5c382e": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "b6f1018c30814b4fb6c03259c4578d29": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_310d3f2be2b440059c272331cadb6c7a",
              "IPY_MODEL_d878ce876bb1401db39655183e58f8de",
              "IPY_MODEL_03917c06e9ea4f75b83181fa63667aeb"
            ],
            "layout": "IPY_MODEL_5152260ab23b452d9ee3f649ba6c6612"
          }
        },
        "310d3f2be2b440059c272331cadb6c7a": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_3dae65fc907144db8e3a1720b59e1198",
            "placeholder": "​",
            "style": "IPY_MODEL_ffff11a1cc5a43c59c4eb41d11b17164",
            "value": "Downloading: 100%"
          }
        },
        "d878ce876bb1401db39655183e58f8de": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_1cba114438ee49ebae4fb38b53472e3e",
            "max": 280,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_5abfaba7bb744c48948f919edf819432",
            "value": 280
          }
        },
        "03917c06e9ea4f75b83181fa63667aeb": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_b1d62cb226104f6cad9c3c084d9e1596",
            "placeholder": "​",
            "style": "IPY_MODEL_eb5dbcbe628c4cd1ae2c2d5879add887",
            "value": " 280/280 [00:00&lt;00:00, 8.94kB/s]"
          }
        },
        "5152260ab23b452d9ee3f649ba6c6612": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "3dae65fc907144db8e3a1720b59e1198": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "ffff11a1cc5a43c59c4eb41d11b17164": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "1cba114438ee49ebae4fb38b53472e3e": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "5abfaba7bb744c48948f919edf819432": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "b1d62cb226104f6cad9c3c084d9e1596": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "eb5dbcbe628c4cd1ae2c2d5879add887": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "f22d29fe964b409fbbc3c28bb144ffe0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_a835d599558a4fedb53b808fe20263d5",
              "IPY_MODEL_21396bd891f94910bc1688a7d405ecd5",
              "IPY_MODEL_ab5049cab6884cbba4297f351541dccc"
            ],
            "layout": "IPY_MODEL_2ca17788139b459c854da5dfce08bfa9"
          }
        },
        "a835d599558a4fedb53b808fe20263d5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_3b719898c28940faa56ce9e346dda660",
            "placeholder": "​",
            "style": "IPY_MODEL_47a78f30c9094b49996abb4c92a7cd00",
            "value": "Downloading: 100%"
          }
        },
        "21396bd891f94910bc1688a7d405ecd5": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_18fd6e7972994a79b627f76cb31282d3",
            "max": 774,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_3a1b881e65ec47b08b85c0437d2d6724",
            "value": 774
          }
        },
        "ab5049cab6884cbba4297f351541dccc": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_09504fd02214477ca6bf0d3c25148827",
            "placeholder": "​",
            "style": "IPY_MODEL_0d0835892c544a86aade3c12a00cad1f",
            "value": " 774/774 [00:00&lt;00:00, 23.0kB/s]"
          }
        },
        "2ca17788139b459c854da5dfce08bfa9": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "3b719898c28940faa56ce9e346dda660": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "47a78f30c9094b49996abb4c92a7cd00": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "18fd6e7972994a79b627f76cb31282d3": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "3a1b881e65ec47b08b85c0437d2d6724": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "09504fd02214477ca6bf0d3c25148827": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "0d0835892c544a86aade3c12a00cad1f": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "cef7746871064d068f5da7fb9e3205d0": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HBoxModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HBoxModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HBoxView",
            "box_style": "",
            "children": [
              "IPY_MODEL_8c26e8c602754b6d82f6b3a64c915e20",
              "IPY_MODEL_968b15898ec44aa6b9870976405be7bc",
              "IPY_MODEL_4b0617a57ec94c3eb69e183677bdc030"
            ],
            "layout": "IPY_MODEL_b27bd6e3bfd94bdba426c7f622ca51cc"
          }
        },
        "8c26e8c602754b6d82f6b3a64c915e20": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_4e8c2b61b2b24693a48bde72e8895700",
            "placeholder": "​",
            "style": "IPY_MODEL_b9a751d8b82148d98eca5811efdb89e8",
            "value": "Downloading: 100%"
          }
        },
        "968b15898ec44aa6b9870976405be7bc": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "FloatProgressModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "FloatProgressModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "ProgressView",
            "bar_style": "success",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_ce89f5c382e04b4dac3a60de8e196505",
            "max": 1136743583,
            "min": 0,
            "orientation": "horizontal",
            "style": "IPY_MODEL_baade606d143400e8c7b1c1be69f1e53",
            "value": 1136743583
          }
        },
        "4b0617a57ec94c3eb69e183677bdc030": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "HTMLModel",
          "model_module_version": "1.5.0",
          "state": {
            "_dom_classes": [],
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "HTMLModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/controls",
            "_view_module_version": "1.5.0",
            "_view_name": "HTMLView",
            "description": "",
            "description_tooltip": null,
            "layout": "IPY_MODEL_5ed219c7989b46b6a7d4a61f36edd5ca",
            "placeholder": "​",
            "style": "IPY_MODEL_481a6f0057eb4e23835f5fd6609838b4",
            "value": " 1.14G/1.14G [00:19&lt;00:00, 60.4MB/s]"
          }
        },
        "b27bd6e3bfd94bdba426c7f622ca51cc": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "4e8c2b61b2b24693a48bde72e8895700": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "b9a751d8b82148d98eca5811efdb89e8": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        },
        "ce89f5c382e04b4dac3a60de8e196505": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "baade606d143400e8c7b1c1be69f1e53": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "ProgressStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "ProgressStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "bar_color": null,
            "description_width": ""
          }
        },
        "5ed219c7989b46b6a7d4a61f36edd5ca": {
          "model_module": "@jupyter-widgets/base",
          "model_name": "LayoutModel",
          "model_module_version": "1.2.0",
          "state": {
            "_model_module": "@jupyter-widgets/base",
            "_model_module_version": "1.2.0",
            "_model_name": "LayoutModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "LayoutView",
            "align_content": null,
            "align_items": null,
            "align_self": null,
            "border": null,
            "bottom": null,
            "display": null,
            "flex": null,
            "flex_flow": null,
            "grid_area": null,
            "grid_auto_columns": null,
            "grid_auto_flow": null,
            "grid_auto_rows": null,
            "grid_column": null,
            "grid_gap": null,
            "grid_row": null,
            "grid_template_areas": null,
            "grid_template_columns": null,
            "grid_template_rows": null,
            "height": null,
            "justify_content": null,
            "justify_items": null,
            "left": null,
            "margin": null,
            "max_height": null,
            "max_width": null,
            "min_height": null,
            "min_width": null,
            "object_fit": null,
            "object_position": null,
            "order": null,
            "overflow": null,
            "overflow_x": null,
            "overflow_y": null,
            "padding": null,
            "right": null,
            "top": null,
            "visibility": null,
            "width": null
          }
        },
        "481a6f0057eb4e23835f5fd6609838b4": {
          "model_module": "@jupyter-widgets/controls",
          "model_name": "DescriptionStyleModel",
          "model_module_version": "1.5.0",
          "state": {
            "_model_module": "@jupyter-widgets/controls",
            "_model_module_version": "1.5.0",
            "_model_name": "DescriptionStyleModel",
            "_view_count": null,
            "_view_module": "@jupyter-widgets/base",
            "_view_module_version": "1.2.0",
            "_view_name": "StyleView",
            "description_width": ""
          }
        }
      }
    }
  },
  "cells": [
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "view-in-github",
        "colab_type": "text"
      },
      "source": [
        "<a href=\"https://colab.research.google.com/github/NielsRogge/Transformers-Tutorials/blob/master/LiLT/Fine_tune_LiLT_on_a_custom_dataset%2C_in_any_language.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Set-up environment"
      ],
      "metadata": {
        "id": "HsOZsfXh9dDl"
      }
    },
    {
      "cell_type": "code",
      "execution_count": 1,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "S2rXhHq49ZS_",
        "outputId": "37bf3df8-3ef5-4b5b-811a-06558d088b98"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "\u001b[K     |████████████████████████████████| 5.5 MB 4.9 MB/s \n",
            "\u001b[K     |████████████████████████████████| 451 kB 53.4 MB/s \n",
            "\u001b[K     |████████████████████████████████| 7.6 MB 56.1 MB/s \n",
            "\u001b[K     |████████████████████████████████| 182 kB 59.2 MB/s \n",
            "\u001b[K     |████████████████████████████████| 212 kB 26.3 MB/s \n",
            "\u001b[K     |████████████████████████████████| 115 kB 14.9 MB/s \n",
            "\u001b[K     |████████████████████████████████| 127 kB 56.2 MB/s \n",
            "\u001b[?25h"
          ]
        }
      ],
      "source": [
        "!pip install -q transformers datasets"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "!pip install -q evaluate seqeval"
      ],
      "metadata": {
        "id": "lejWIoXqEr5w"
      },
      "execution_count": 26,
      "outputs": []
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Load dataset"
      ],
      "metadata": {
        "id": "skz8D8B99el5"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "from datasets import load_dataset\n",
        "\n",
        "dataset = load_dataset(\"nielsr/funsd-iob-original\")"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 201,
          "referenced_widgets": [
            "26027cc52efb4feca46aa1a01733dd4b",
            "d897b42b3b5b459d9ff687639183b552",
            "bf43e1f0f4ba431fa014fd806ab2ad45",
            "2504de0eb9334ffc9f1355ce7ee64818",
            "7911d4111ef64aecb1e5183f992c265a",
            "7b87d03d51b34ad9a294759759bb2f99",
            "95d199b642ed4283bdd862482221c0ad",
            "fb6fd341e4a247a7be15f991f6de1a68",
            "f4c3210b551c4abfa39097e649370705",
            "a5fe90782b384126ad81ba1b6749f9ea",
            "bcbec24e8f404d6bb3b6c2369a38e65f",
            "5c627e87f7494df3b5f4dd03dfefc418",
            "e0c00ec80bda4a6a82bff73f90d030c7",
            "6e64fb08e62245aba542f8b0620867bd",
            "db7fd605466f46389f08fce3c9f9e8cc",
            "6de6872a78094986ad307d3e92b993c9",
            "72a924a38b064482a45e6117f5d131c6",
            "ee4166e279334e38bcf43bcaf181a5ec",
            "d41c282ebce14abda7708029c72e7c21",
            "2efe04a43816414da96074a4ff28523f",
            "e406f248c67545288dcc510f9b0238aa",
            "3ae8c110c7d14457aa849784dbf968ed",
            "1aa4e61ec0ee45f4ba937833a51716e7",
            "9b7f7bcfcbe04f0d8e147cec9d9252ea",
            "0b230cb2cc5549f6a00eda91602aea02",
            "2cb6623348e749cf9c22e0f7e541cc9a",
            "1b6efff4d94b47daa8cf9056ebf6881e",
            "6cfb973d68784a9eb95855fcfc7fafef",
            "fdf041057e904896a1d8e502840145b0",
            "cba93c8e650848a9a642f00d472b6765",
            "6b27dce746f94f78978ed0fea4afd8a1",
            "8c058e72c1c8459f8800b713c1324ac2",
            "6204a3bbdfed46b2ba37b8aac9d1f600",
            "61b6c665bcc64b33a6428fbdd837ec7a",
            "9abcec8061eb42209466455128baa4c0",
            "12f2250e8dae4bac9b94703d5a5a7a0e",
            "8ee8a7a78a7c4abcbf4cb5bd099a827c",
            "00ba5d048c6b41d2b4a539ac0760d644",
            "1ab8396aacf5486793308b4bcd8f97e5",
            "3e4547993edb45bfa150ca845c4dfdc1",
            "2f772e889f2a41dab88f79c7735c8aab",
            "114e1ac91d864d448fb09ae4a34dded5",
            "b6f720ab46604a62bc7d720cb18749c8",
            "537eb09f486d4bb688a1d2fdbff7d4fe",
            "aafd329e9da9494997783c62e3cd048c",
            "da8b7055a7504078800ead5184677f95",
            "374f00dd5e6a454ca6f18691da6ea645",
            "d6ddbfe8779b46eaa10be5827de80224",
            "39d5a93e941a498e82520de590d16524",
            "b85426c0f15a448f8271b4402f276236",
            "0f54316b16ba43d8bfa3881321fa85f2",
            "61a2203f68cf4700a774e5f14bbcdc72",
            "72b29a8a04aa4e9fae4c80f165a8c3c4",
            "7f686c6833e346db89c16038bcb21667",
            "baffb4a1f4f446e4881c057e5526ffaf"
          ]
        },
        "id": "IAqIvO699cuP",
        "outputId": "0b280d17-42c7-4b31-f3b1-fcc314b60526"
      },
      "execution_count": 2,
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Downloading builder script:   0%|          | 0.00/4.85k [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "26027cc52efb4feca46aa1a01733dd4b"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Downloading and preparing dataset funsd-iob-original/funsd to /root/.cache/huggingface/datasets/nielsr___funsd-iob-original/funsd/1.0.0/cc411fe09328f1b872ea528393c33f0252ef52c2c8675385ffcd39b449bfcf34...\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Downloading data:   0%|          | 0.00/16.8M [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "5c627e87f7494df3b5f4dd03dfefc418"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Generating train split: 0 examples [00:00, ? examples/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "1aa4e61ec0ee45f4ba937833a51716e7"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Generating test split: 0 examples [00:00, ? examples/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "61b6c665bcc64b33a6428fbdd837ec7a"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Dataset funsd-iob-original downloaded and prepared to /root/.cache/huggingface/datasets/nielsr___funsd-iob-original/funsd/1.0.0/cc411fe09328f1b872ea528393c33f0252ef52c2c8675385ffcd39b449bfcf34. Subsequent calls will reuse this data.\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "  0%|          | 0/2 [00:00<?, ?it/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "aafd329e9da9494997783c62e3cd048c"
            }
          },
          "metadata": {}
        }
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 3,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "T-0CAn459X_d",
        "outputId": "ae74d1ee-7304-454b-ad01-b94ca3dc8c36"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "{0: 'O', 1: 'B-HEADER', 2: 'I-HEADER', 3: 'B-QUESTION', 4: 'I-QUESTION', 5: 'B-ANSWER', 6: 'I-ANSWER'}\n"
          ]
        }
      ],
      "source": [
        "label_list = dataset[\"train\"].features[\"ner_tags\"].feature.names\n",
        "id2label = {id:label for id, label in enumerate(label_list)}\n",
        "print(id2label)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "4uzGtQ-wyab4"
      },
      "source": [
        "## Create PyTorch Dataset"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 4,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "q5LrhM720c8M",
        "outputId": "cb5d1bff-a7b6-4e45-ddad-7e1f477e3245"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "{'id': Value(dtype='string', id=None),\n",
              " 'words': Sequence(feature=Value(dtype='string', id=None), length=-1, id=None),\n",
              " 'bboxes': Sequence(feature=Sequence(feature=Value(dtype='int64', id=None), length=-1, id=None), length=-1, id=None),\n",
              " 'original_bboxes': Sequence(feature=Sequence(feature=Value(dtype='int64', id=None), length=-1, id=None), length=-1, id=None),\n",
              " 'ner_tags': Sequence(feature=ClassLabel(names=['O', 'B-HEADER', 'I-HEADER', 'B-QUESTION', 'I-QUESTION', 'B-ANSWER', 'I-ANSWER'], id=None), length=-1, id=None),\n",
              " 'image': Image(decode=True, id=None)}"
            ]
          },
          "metadata": {},
          "execution_count": 4
        }
      ],
      "source": [
        "dataset[\"train\"].features"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 6,
      "metadata": {
        "id": "UenGHEUOyeNm"
      },
      "outputs": [],
      "source": [
        "from torch.utils.data import Dataset\n",
        "from PIL import Image\n",
        "import torch\n",
        "\n",
        "def normalize_bbox(bbox, width, height):\n",
        "    return [\n",
        "        int(1000 * (bbox[0] / width)),\n",
        "        int(1000 * (bbox[1] / height)),\n",
        "        int(1000 * (bbox[2] / width)),\n",
        "        int(1000 * (bbox[3] / height)),\n",
        "    ]\n",
        "\n",
        "class CustomDataset(Dataset):\n",
        "  def __init__(self, dataset, tokenizer):\n",
        "    self.dataset = dataset\n",
        "    self.tokenizer = tokenizer\n",
        "\n",
        "  def __len__(self):\n",
        "    return len(self.dataset)\n",
        "\n",
        "  def __getitem__(self, idx):\n",
        "    # get item\n",
        "    example = self.dataset[idx]\n",
        "    image = example[\"image\"]\n",
        "    words = example[\"words\"]\n",
        "    boxes = example[\"original_bboxes\"]\n",
        "    ner_tags = example[\"ner_tags\"]\n",
        "\n",
        "    # prepare for the model\n",
        "    width, height = image.size\n",
        "\n",
        "    bbox = []\n",
        "    labels = []\n",
        "    for word, box, label in zip(words, boxes, ner_tags):\n",
        "        box = normalize_bbox(box, width, height)\n",
        "        n_word_tokens = len(tokenizer.tokenize(word))\n",
        "        bbox.extend([box] * n_word_tokens)\n",
        "        labels.extend([label] + ([-100] * (n_word_tokens - 1)))\n",
        "\n",
        "    cls_box = sep_box = [0, 0, 0, 0]\n",
        "    bbox = [cls_box] + bbox + [sep_box]\n",
        "    labels = [-100] + labels + [-100]\n",
        "\n",
        "    encoding = self.tokenizer(\" \".join(words), truncation=True, max_length=512)\n",
        "    sequence_length = len(encoding.input_ids)\n",
        "    # truncate boxes and labels based on length of input ids\n",
        "    labels = labels[:sequence_length]\n",
        "    bbox = bbox[:sequence_length] \n",
        "\n",
        "    encoding[\"bbox\"] = bbox\n",
        "    encoding[\"labels\"] = labels\n",
        "    \n",
        "    return encoding"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 7,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 113,
          "referenced_widgets": [
            "161f6492fc9a4b5b8dcb6b60d30075e8",
            "9825f686be2d452b9d06b9f70311b261",
            "f4ea6e3e24f44f6e8d57793761a7a0da",
            "a658ee8508d346b6898717068a0da9ea",
            "e5e95dfd23b4469b80a1155b83517289",
            "69770719773a4de7860c7e8b248a48ca",
            "60925aec159443f5bbfeeded44c3376b",
            "e27da60124204337ba49a056967a6705",
            "8f8b573548a34f8595ac0addebc04bc7",
            "f639a3cc02d34370ac548e6c770051d7",
            "2782209b9140456ca6b39cde121936e5",
            "705d9ca2025146cf841435ca3b8d725b",
            "1aab71f014c945ac8f3ec865c0f90653",
            "b7635b079d2044308a883cdc48339a34",
            "86574ef4f6ab49e3a7bae77674e45062",
            "d849196f8f08429e91158b442fcc99d3",
            "6a60593b74fb46e8899a05ca0f703615",
            "1f9870a33ba24530ba3c8efebe93ef2f",
            "500ef74c2b4246199a7e28bf97eeda74",
            "a68f9736f07f4d1e96ed3388ead89cf5",
            "20c6cfdd855c4e26b53798d475771f0a",
            "08428693c6da4b31aed698696d5c382e",
            "b6f1018c30814b4fb6c03259c4578d29",
            "310d3f2be2b440059c272331cadb6c7a",
            "d878ce876bb1401db39655183e58f8de",
            "03917c06e9ea4f75b83181fa63667aeb",
            "5152260ab23b452d9ee3f649ba6c6612",
            "3dae65fc907144db8e3a1720b59e1198",
            "ffff11a1cc5a43c59c4eb41d11b17164",
            "1cba114438ee49ebae4fb38b53472e3e",
            "5abfaba7bb744c48948f919edf819432",
            "b1d62cb226104f6cad9c3c084d9e1596",
            "eb5dbcbe628c4cd1ae2c2d5879add887"
          ]
        },
        "id": "TNSxzw3cxzR4",
        "outputId": "0bc233eb-6f86-459a-bc94-4d85e88a62a1"
      },
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Downloading:   0%|          | 0.00/451 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "161f6492fc9a4b5b8dcb6b60d30075e8"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Downloading:   0%|          | 0.00/17.1M [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "705d9ca2025146cf841435ca3b8d725b"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Downloading:   0%|          | 0.00/280 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "b6f1018c30814b4fb6c03259c4578d29"
            }
          },
          "metadata": {}
        }
      ],
      "source": [
        "from transformers import AutoTokenizer\n",
        "\n",
        "tokenizer = AutoTokenizer.from_pretrained(\"nielsr/lilt-xlm-roberta-base\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 8,
      "metadata": {
        "id": "5aOPVOj4yobW"
      },
      "outputs": [],
      "source": [
        "train_dataset = CustomDataset(dataset[\"train\"], tokenizer)\n",
        "eval_dataset = CustomDataset(dataset[\"test\"], tokenizer)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 9,
      "metadata": {
        "id": "t_P7p9Oz6W5v"
      },
      "outputs": [],
      "source": [
        "example = train_dataset[0]"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 10,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 143
        },
        "id": "4zCD1gGX6YJ7",
        "outputId": "65a86f89-1c39-4da3-ea8c-19ada991f521"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "'<s> R&D : Suggestion: Date: Licensee Yes No 597005708 R&D QUALITY IMPROVEMENT SUGGESTION/ SOLUTION FORM Name / Phone Ext. : M. Hamann P. Harper, P. Martinez 9/ 3/ 92 R&D Group: J. S. Wigand Supervisor / Manager Discontinue coal retention analyses on licensee submitted product samples (Note : Coal Retention testing is not performed by most licensees. Other B&W physical measurements as ends stability and inspection for soft spots in ciparettes are thought to be sufficient measures to assure cigarette physical integrity. The proposed action will increase laboratory productivity. ) Suggested Solutions (s) : Delete coal retention from the list of standard analyses performed on licensee submitted product samples. Special requests for coal retention testing could still be submitted on an exception basis. Have you contacted your Manager/ Supervisor? Manager Comments: Manager, please contact suggester and forward comments to the Quality Council. qip. wp</s>'"
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "string"
            }
          },
          "metadata": {},
          "execution_count": 10
        }
      ],
      "source": [
        "tokenizer.decode(example[\"input_ids\"])"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 11,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "ArWb-ILbK-3x",
        "outputId": "99092567-1dc0-485a-bdcc-ff9906326f60"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "input_ids 244\n",
            "attention_mask 244\n",
            "bbox 244\n",
            "labels 244\n"
          ]
        }
      ],
      "source": [
        "for k,v in example.items():\n",
        "  print(k,len(v))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 12,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "xUfyC_mWH-oE",
        "outputId": "3ce5e1f3-6199-45ff-fa8a-e7db58acaaf1"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "R&D [292, 91, 376, 175] O\n",
            ": [219, 316, 225, 327] B-QUESTION\n",
            "Suggestion: [95, 355, 169, 370] B-QUESTION\n",
            "Date: [482, 268, 518, 282] B-QUESTION\n",
            "Licensee [511, 309, 570, 323] B-ANSWER\n",
            "Yes [461, 605, 483, 619] B-QUESTION\n",
            "No [545, 603, 563, 617] B-QUESTION\n",
            "597005708 [525, 904, 641, 926] O\n",
            "R&D [257, 203, 279, 214] B-HEADER\n",
            "QUALITY [285, 203, 334, 216] I-HEADER\n",
            "IMPROVEMENT [341, 201, 418, 211] I-HEADER\n",
            "SUGGESTION/ [256, 215, 324, 229] I-HEADER\n",
            "SOLUTION [331, 214, 387, 228] I-HEADER\n",
            "FORM [395, 215, 423, 228] I-HEADER\n",
            "Name [89, 274, 118, 289] B-QUESTION\n",
            "/ [117, 274, 127, 288] I-QUESTION\n",
            "Phone [128, 274, 163, 289] I-QUESTION\n",
            "Ext. [169, 272, 196, 287] I-QUESTION\n",
            ": [196, 274, 204, 288] I-QUESTION\n",
            "M. [215, 272, 230, 287] B-ANSWER\n",
            "Hamann [237, 272, 287, 286] I-ANSWER\n",
            "P. [293, 272, 307, 286] I-ANSWER\n",
            "Harper, [314, 274, 363, 285] I-ANSWER\n",
            "P. [370, 272, 384, 285] I-ANSWER\n",
            "Martinez [390, 271, 451, 282] I-ANSWER\n",
            "9/ [543, 265, 560, 279] B-ANSWER\n",
            "3/ [560, 264, 575, 279] I-ANSWER\n",
            "92 [575, 264, 590, 279] I-ANSWER\n",
            "R&D [420, 310, 442, 323] B-QUESTION\n",
            "Group: [448, 310, 491, 323] I-QUESTION\n",
            "J. [236, 313, 251, 327] B-ANSWER\n",
            "S. [256, 313, 273, 326] I-ANSWER\n",
            "Wigand [278, 313, 327, 327] I-ANSWER\n",
            "Supervisor [91, 316, 161, 330] B-QUESTION\n",
            "/ [163, 318, 169, 331] I-QUESTION\n",
            "Manager [169, 317, 218, 327] I-QUESTION\n",
            "Discontinue [190, 355, 268, 366] B-ANSWER\n",
            "coal [274, 353, 303, 366] I-ANSWER\n",
            "retention [309, 352, 375, 365] I-ANSWER\n",
            "analyses [381, 351, 435, 365] I-ANSWER\n",
            "on [443, 352, 458, 363] I-ANSWER\n",
            "licensee [464, 348, 520, 362] I-ANSWER\n",
            "submitted [527, 346, 594, 361] I-ANSWER\n",
            "product [190, 369, 240, 383] I-ANSWER\n",
            "samples [247, 367, 301, 380] I-ANSWER\n",
            "(Note [318, 365, 352, 379] I-ANSWER\n",
            ": [352, 367, 359, 380] I-ANSWER\n",
            "Coal [373, 366, 402, 376] I-ANSWER\n",
            "Retention [408, 366, 472, 376] I-ANSWER\n",
            "testing [479, 365, 529, 376] I-ANSWER\n",
            "is [536, 363, 549, 374] I-ANSWER\n",
            "not [554, 363, 578, 374] I-ANSWER\n",
            "performed [190, 383, 256, 394] I-ANSWER\n",
            "by [261, 381, 275, 394] I-ANSWER\n",
            "most [282, 383, 311, 393] I-ANSWER\n",
            "licensees. [318, 380, 386, 391] I-ANSWER\n",
            "Other [401, 378, 437, 389] I-ANSWER\n",
            "B&W [443, 378, 465, 389] I-ANSWER\n",
            "physical [471, 377, 528, 391] I-ANSWER\n",
            "measurements [191, 398, 275, 406] I-ANSWER\n",
            "as [282, 397, 297, 405] I-ANSWER\n",
            "ends [304, 394, 332, 405] I-ANSWER\n",
            "stability [339, 394, 402, 405] I-ANSWER\n",
            "and [409, 392, 430, 402] I-ANSWER\n",
            "inspection [437, 392, 508, 403] I-ANSWER\n",
            "for [515, 391, 535, 402] I-ANSWER\n",
            "soft [542, 391, 571, 401] I-ANSWER\n",
            "spots [193, 411, 228, 422] I-ANSWER\n",
            "in [235, 409, 250, 420] I-ANSWER\n",
            "ciparettes [256, 409, 327, 419] I-ANSWER\n",
            "are [332, 408, 352, 418] I-ANSWER\n",
            "thought [360, 406, 410, 419] I-ANSWER\n",
            "to [415, 406, 430, 416] I-ANSWER\n",
            "be [436, 404, 453, 417] I-ANSWER\n",
            "sufficient [458, 405, 529, 415] I-ANSWER\n",
            "measures [535, 405, 592, 415] I-ANSWER\n",
            "to [193, 425, 208, 433] I-ANSWER\n",
            "assure [214, 423, 255, 431] I-ANSWER\n",
            "cigarette [261, 420, 325, 434] I-ANSWER\n",
            "physical [331, 419, 390, 432] I-ANSWER\n",
            "integrity. [395, 418, 463, 431] I-ANSWER\n",
            "The [478, 416, 500, 429] I-ANSWER\n",
            "proposed [506, 418, 566, 431] I-ANSWER\n",
            "action [193, 436, 236, 447] I-ANSWER\n",
            "will [240, 436, 269, 447] I-ANSWER\n",
            "increase [277, 434, 333, 445] I-ANSWER\n",
            "laboratory [339, 433, 410, 446] I-ANSWER\n",
            "productivity [418, 430, 502, 445] I-ANSWER\n",
            ". [503, 433, 507, 444] I-ANSWER\n",
            ") [508, 430, 514, 444] I-ANSWER\n",
            "Suggested [95, 489, 159, 504] B-QUESTION\n",
            "Solutions [165, 487, 222, 501] I-QUESTION\n",
            "(s) [223, 486, 241, 503] I-QUESTION\n",
            ": [243, 489, 250, 503] I-QUESTION\n",
            "Delete [263, 486, 306, 500] B-ANSWER\n",
            "coal [313, 486, 341, 499] I-ANSWER\n",
            "retention [348, 486, 412, 497] I-ANSWER\n",
            "from [416, 485, 447, 498] I-ANSWER\n",
            "the [453, 485, 475, 498] I-ANSWER\n",
            "list [480, 483, 508, 496] I-ANSWER\n",
            "of [515, 483, 532, 494] I-ANSWER\n",
            "standard [536, 483, 593, 494] I-ANSWER\n",
            "analyses [264, 501, 320, 514] I-ANSWER\n",
            "performed [324, 501, 392, 512] I-ANSWER\n",
            "on [397, 501, 412, 511] I-ANSWER\n",
            "licensee [419, 499, 475, 512] I-ANSWER\n",
            "submitted [482, 499, 546, 510] I-ANSWER\n",
            "product [264, 517, 314, 528] I-ANSWER\n",
            "samples. [320, 514, 374, 528] I-ANSWER\n",
            "Special [390, 513, 439, 526] I-ANSWER\n",
            "requests [446, 513, 502, 524] I-ANSWER\n",
            "for [508, 511, 530, 522] I-ANSWER\n",
            "coal [538, 510, 566, 523] I-ANSWER\n",
            "retention [263, 529, 330, 540] I-ANSWER\n",
            "testing [335, 527, 387, 540] I-ANSWER\n",
            "could [390, 527, 428, 538] I-ANSWER\n",
            "still [433, 525, 468, 536] I-ANSWER\n",
            "be [473, 525, 488, 535] I-ANSWER\n",
            "submitted [496, 524, 560, 537] I-ANSWER\n",
            "on [566, 524, 584, 537] I-ANSWER\n",
            "an [264, 543, 281, 553] I-ANSWER\n",
            "exception [286, 539, 350, 553] I-ANSWER\n",
            "basis. [355, 541, 397, 551] I-ANSWER\n",
            "Have [96, 612, 127, 623] B-HEADER\n",
            "you [131, 613, 156, 624] I-HEADER\n",
            "contacted [161, 612, 225, 623] I-HEADER\n",
            "your [229, 610, 260, 623] I-HEADER\n",
            "Manager/ [264, 609, 314, 622] I-HEADER\n",
            "Supervisor? [323, 608, 398, 621] I-HEADER\n",
            "Manager [98, 654, 150, 665] B-QUESTION\n",
            "Comments: [154, 651, 211, 664] I-QUESTION\n",
            "Manager, [232, 648, 288, 662] B-ANSWER\n",
            "please [296, 649, 338, 662] I-ANSWER\n",
            "contact [344, 648, 394, 662] I-ANSWER\n",
            "suggester [401, 648, 464, 661] I-ANSWER\n",
            "and [469, 647, 491, 658] I-ANSWER\n",
            "forward [497, 644, 547, 657] I-ANSWER\n",
            "comments [99, 666, 155, 677] B-ANSWER\n",
            "to [162, 665, 177, 676] I-ANSWER\n",
            "the [183, 665, 205, 675] I-ANSWER\n",
            "Quality [211, 663, 261, 676] I-ANSWER\n",
            "Council. [267, 662, 323, 676] I-ANSWER\n",
            "qip [102, 824, 123, 837] O\n",
            ". [124, 824, 130, 838] O\n",
            "wp [130, 823, 145, 837] O\n"
          ]
        }
      ],
      "source": [
        "for word, box, label in zip(dataset[\"train\"][0][\"words\"], dataset[\"train\"][0][\"original_bboxes\"], dataset[\"train\"][0][\"ner_tags\"]):\n",
        "  print(word, box, id2label[label])"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 13,
      "metadata": {
        "id": "7ERmka7YOWD8",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "9a102b19-1458-4c1c-f60e-779862c41244"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "244"
            ]
          },
          "metadata": {},
          "execution_count": 13
        }
      ],
      "source": [
        "len(example[\"input_ids\"])"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 14,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "MGskeGPH8oqX",
        "outputId": "d02511eb-9de0-4938-ef4f-7a116f5da77c"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "<s> [0, 0, 0, 0] -100\n",
            "R [383, 91, 493, 175] O\n",
            "& [383, 91, 493, 175] -100\n",
            "D [383, 91, 493, 175] -100\n",
            ": [287, 316, 295, 327] B-QUESTION\n",
            "Sug [124, 355, 221, 370] B-QUESTION\n",
            "gestion [124, 355, 221, 370] -100\n",
            ": [124, 355, 221, 370] -100\n",
            "Date [632, 268, 679, 282] B-QUESTION\n",
            ": [632, 268, 679, 282] -100\n",
            "License [670, 309, 748, 323] B-ANSWER\n",
            "e [670, 309, 748, 323] -100\n",
            "Yes [604, 605, 633, 619] B-QUESTION\n",
            "No [715, 603, 738, 617] B-QUESTION\n",
            " [688, 904, 841, 926] O\n",
            "597 [688, 904, 841, 926] -100\n",
            "005 [688, 904, 841, 926] -100\n",
            "708 [688, 904, 841, 926] -100\n",
            "R [337, 203, 366, 214] B-HEADER\n",
            "& [337, 203, 366, 214] -100\n",
            "D [337, 203, 366, 214] -100\n",
            "QUAL [374, 203, 438, 216] I-HEADER\n",
            "ITY [374, 203, 438, 216] -100\n",
            "IMP [447, 201, 548, 211] I-HEADER\n",
            "ROV [447, 201, 548, 211] -100\n",
            "EMENT [447, 201, 548, 211] -100\n",
            "S [335, 215, 425, 229] I-HEADER\n",
            "UG [335, 215, 425, 229] -100\n",
            "GES [335, 215, 425, 229] -100\n",
            "TION [335, 215, 425, 229] -100\n",
            "/ [335, 215, 425, 229] -100\n",
            "S [434, 214, 507, 228] I-HEADER\n",
            "OLU [434, 214, 507, 228] -100\n",
            "TION [434, 214, 507, 228] -100\n",
            " [518, 215, 555, 228] I-HEADER\n",
            "FORM [518, 215, 555, 228] -100\n",
            "Name [116, 274, 154, 289] B-QUESTION\n",
            "/ [153, 274, 166, 288] I-QUESTION\n",
            "Phone [167, 274, 213, 289] I-QUESTION\n",
            "Ex [221, 272, 257, 287] I-QUESTION\n",
            "t [221, 272, 257, 287] -100\n",
            ". [221, 272, 257, 287] -100\n",
            ": [257, 274, 267, 288] I-QUESTION\n",
            "M [282, 272, 301, 287] B-ANSWER\n",
            ". [282, 272, 301, 287] -100\n",
            "Ha [311, 272, 376, 286] I-ANSWER\n",
            "mann [311, 272, 376, 286] -100\n",
            "P [384, 272, 402, 286] I-ANSWER\n",
            ". [384, 272, 402, 286] -100\n",
            "Har [412, 274, 476, 285] I-ANSWER\n",
            "per [412, 274, 476, 285] -100\n",
            ", [412, 274, 476, 285] -100\n",
            "P [485, 272, 503, 285] I-ANSWER\n",
            ". [485, 272, 503, 285] -100\n",
            "Martin [511, 271, 591, 282] I-ANSWER\n",
            "ez [511, 271, 591, 282] -100\n",
            "9 [712, 265, 734, 279] B-ANSWER\n",
            "/ [712, 265, 734, 279] -100\n",
            "3 [734, 264, 754, 279] I-ANSWER\n",
            "/ [734, 264, 754, 279] -100\n",
            "92 [754, 264, 774, 279] I-ANSWER\n",
            "R [551, 310, 580, 323] B-QUESTION\n",
            "& [551, 310, 580, 323] -100\n",
            "D [551, 310, 580, 323] -100\n",
            "Group [587, 310, 644, 323] I-QUESTION\n",
            ": [587, 310, 644, 323] -100\n",
            "J [309, 313, 329, 327] B-ANSWER\n",
            ". [309, 313, 329, 327] -100\n",
            "S [335, 313, 358, 326] I-ANSWER\n",
            ". [335, 313, 358, 326] -100\n",
            "Wi [364, 313, 429, 327] I-ANSWER\n",
            "gan [364, 313, 429, 327] -100\n",
            "d [364, 313, 429, 327] -100\n",
            "Super [119, 316, 211, 330] B-QUESTION\n",
            "visor [119, 316, 211, 330] -100\n",
            "/ [213, 318, 221, 331] I-QUESTION\n",
            "Manager [221, 317, 286, 327] I-QUESTION\n",
            "Dis [249, 355, 351, 366] B-ANSWER\n",
            "continu [249, 355, 351, 366] -100\n",
            "e [249, 355, 351, 366] -100\n",
            "co [359, 353, 397, 366] I-ANSWER\n",
            "al [359, 353, 397, 366] -100\n",
            "re [405, 352, 492, 365] I-ANSWER\n",
            "tention [405, 352, 492, 365] -100\n",
            "analyse [500, 351, 570, 365] I-ANSWER\n",
            "s [500, 351, 570, 365] -100\n",
            "on [581, 352, 601, 363] I-ANSWER\n",
            "license [608, 348, 682, 362] I-ANSWER\n",
            "e [608, 348, 682, 362] -100\n",
            "submitted [691, 346, 779, 361] I-ANSWER\n",
            "product [249, 369, 314, 383] I-ANSWER\n",
            "sample [324, 367, 395, 380] I-ANSWER\n",
            "s [324, 367, 395, 380] -100\n",
            "( [417, 365, 461, 379] I-ANSWER\n",
            "Note [417, 365, 461, 379] -100\n",
            ": [461, 367, 471, 380] I-ANSWER\n",
            "Co [489, 366, 527, 376] I-ANSWER\n",
            "al [489, 366, 527, 376] -100\n",
            "Re [535, 366, 619, 376] I-ANSWER\n",
            "tention [535, 366, 619, 376] -100\n",
            "testing [628, 365, 694, 376] I-ANSWER\n",
            "is [703, 363, 720, 374] I-ANSWER\n",
            "not [727, 363, 758, 374] I-ANSWER\n",
            "perform [249, 383, 335, 394] I-ANSWER\n",
            "ed [249, 383, 335, 394] -100\n",
            "by [342, 381, 360, 394] I-ANSWER\n",
            "most [370, 383, 408, 393] I-ANSWER\n",
            "license [417, 380, 506, 391] I-ANSWER\n",
            "es [417, 380, 506, 391] -100\n",
            ". [417, 380, 506, 391] -100\n",
            "Other [526, 378, 573, 389] I-ANSWER\n",
            "B [581, 378, 610, 389] I-ANSWER\n",
            "& [581, 378, 610, 389] -100\n",
            "W [581, 378, 610, 389] -100\n",
            "physical [618, 377, 692, 391] I-ANSWER\n",
            "measure [250, 398, 360, 406] I-ANSWER\n",
            "ments [250, 398, 360, 406] -100\n",
            "as [370, 397, 389, 405] I-ANSWER\n",
            "end [398, 394, 435, 405] I-ANSWER\n",
            "s [398, 394, 435, 405] -100\n",
            "stabilit [444, 394, 527, 405] I-ANSWER\n",
            "y [444, 394, 527, 405] -100\n",
            "and [536, 392, 564, 402] I-ANSWER\n",
            "inspect [573, 392, 666, 403] I-ANSWER\n",
            "ion [573, 392, 666, 403] -100\n",
            "for [675, 391, 702, 402] I-ANSWER\n",
            "soft [711, 391, 749, 401] I-ANSWER\n",
            "spot [253, 411, 299, 422] I-ANSWER\n",
            "s [253, 411, 299, 422] -100\n",
            "in [308, 409, 328, 420] I-ANSWER\n",
            "ci [335, 409, 429, 419] I-ANSWER\n",
            "par [335, 409, 429, 419] -100\n",
            "ettes [335, 409, 429, 419] -100\n",
            "are [435, 408, 461, 418] I-ANSWER\n",
            "thought [472, 406, 538, 419] I-ANSWER\n",
            "to [544, 406, 564, 416] I-ANSWER\n",
            "be [572, 404, 594, 417] I-ANSWER\n",
            " [601, 405, 694, 415] I-ANSWER\n",
            "sufficient [601, 405, 694, 415] -100\n",
            "measure [702, 405, 776, 415] I-ANSWER\n",
            "s [702, 405, 776, 415] -100\n",
            "to [253, 425, 272, 433] I-ANSWER\n",
            "assure [280, 423, 334, 431] I-ANSWER\n",
            "cigarette [342, 420, 426, 434] I-ANSWER\n",
            "physical [434, 419, 511, 432] I-ANSWER\n",
            "integr [518, 418, 607, 431] I-ANSWER\n",
            "ity [518, 418, 607, 431] -100\n",
            ". [518, 418, 607, 431] -100\n",
            "The [627, 416, 656, 429] I-ANSWER\n",
            "propose [664, 418, 742, 431] I-ANSWER\n",
            "d [664, 418, 742, 431] -100\n",
            "action [253, 436, 309, 447] I-ANSWER\n",
            "will [314, 436, 353, 447] I-ANSWER\n",
            "increase [363, 434, 437, 445] I-ANSWER\n",
            "laborator [444, 433, 538, 446] I-ANSWER\n",
            "y [444, 433, 538, 446] -100\n",
            "product [548, 430, 658, 445] I-ANSWER\n",
            "ivit [548, 430, 658, 445] -100\n",
            "y [548, 430, 658, 445] -100\n",
            " [660, 433, 665, 444] I-ANSWER\n",
            ". [660, 433, 665, 444] -100\n",
            ") [666, 430, 674, 444] I-ANSWER\n",
            "Sug [124, 489, 208, 504] B-QUESTION\n",
            "ge [124, 489, 208, 504] -100\n",
            "sted [124, 489, 208, 504] -100\n",
            "Solutions [216, 487, 291, 501] I-QUESTION\n",
            "( [292, 486, 316, 503] I-QUESTION\n",
            "s [292, 486, 316, 503] -100\n",
            ") [292, 486, 316, 503] -100\n",
            ": [318, 489, 328, 503] I-QUESTION\n",
            "De [345, 486, 401, 500] B-ANSWER\n",
            "lete [345, 486, 401, 500] -100\n",
            "co [410, 486, 447, 499] I-ANSWER\n",
            "al [410, 486, 447, 499] -100\n",
            "re [456, 486, 540, 497] I-ANSWER\n",
            "tention [456, 486, 540, 497] -100\n",
            "from [545, 485, 586, 498] I-ANSWER\n",
            "the [594, 485, 623, 498] I-ANSWER\n",
            "list [629, 483, 666, 496] I-ANSWER\n",
            "of [675, 483, 698, 494] I-ANSWER\n",
            "standard [703, 483, 778, 494] I-ANSWER\n",
            "analyse [346, 501, 419, 514] I-ANSWER\n",
            "s [346, 501, 419, 514] -100\n",
            "perform [425, 501, 514, 512] I-ANSWER\n",
            "ed [425, 501, 514, 512] -100\n",
            "on [520, 501, 540, 511] I-ANSWER\n",
            "license [549, 499, 623, 512] I-ANSWER\n",
            "e [549, 499, 623, 512] -100\n",
            "submitted [632, 499, 716, 510] I-ANSWER\n",
            "product [346, 517, 412, 528] I-ANSWER\n",
            "sample [419, 514, 490, 528] I-ANSWER\n",
            "s [419, 514, 490, 528] -100\n",
            ". [419, 514, 490, 528] -100\n",
            "Special [511, 513, 576, 526] I-ANSWER\n",
            "request [585, 513, 658, 524] I-ANSWER\n",
            "s [585, 513, 658, 524] -100\n",
            "for [666, 511, 695, 522] I-ANSWER\n",
            "co [706, 510, 742, 523] I-ANSWER\n",
            "al [706, 510, 742, 523] -100\n",
            "re [345, 529, 433, 540] I-ANSWER\n",
            "tention [345, 529, 433, 540] -100\n",
            "testing [439, 527, 507, 540] I-ANSWER\n",
            "could [511, 527, 561, 538] I-ANSWER\n",
            "still [568, 525, 614, 536] I-ANSWER\n",
            "be [620, 525, 640, 535] I-ANSWER\n",
            "submitted [650, 524, 734, 537] I-ANSWER\n",
            "on [742, 524, 766, 537] I-ANSWER\n",
            "an [346, 543, 368, 553] I-ANSWER\n",
            "exception [375, 539, 459, 553] I-ANSWER\n",
            "basis [465, 541, 520, 551] I-ANSWER\n",
            ". [465, 541, 520, 551] -100\n",
            "Have [125, 612, 166, 623] B-HEADER\n",
            "you [171, 613, 204, 624] I-HEADER\n",
            "contact [211, 612, 295, 623] I-HEADER\n",
            "ed [211, 612, 295, 623] -100\n",
            "your [300, 610, 341, 623] I-HEADER\n",
            "Manager [346, 609, 412, 622] I-HEADER\n",
            "/ [346, 609, 412, 622] -100\n",
            "Super [423, 608, 522, 621] I-HEADER\n",
            "visor [423, 608, 522, 621] -100\n",
            "? [423, 608, 522, 621] -100\n",
            "Manager [128, 654, 196, 665] B-QUESTION\n",
            "Comments [202, 651, 276, 664] I-QUESTION\n",
            ": [202, 651, 276, 664] -100\n",
            "Manager [304, 648, 377, 662] B-ANSWER\n",
            ", [304, 648, 377, 662] -100\n",
            "please [388, 649, 443, 662] I-ANSWER\n",
            "contact [451, 648, 517, 662] I-ANSWER\n",
            "suggest [526, 648, 608, 661] I-ANSWER\n",
            "er [526, 648, 608, 661] -100\n",
            "and [615, 647, 644, 658] I-ANSWER\n",
            "forward [652, 644, 717, 657] I-ANSWER\n",
            "comments [129, 666, 203, 677] B-ANSWER\n",
            "to [212, 665, 232, 676] I-ANSWER\n",
            "the [240, 665, 269, 675] I-ANSWER\n",
            "Quality [276, 663, 342, 676] I-ANSWER\n",
            "Council [350, 662, 423, 676] I-ANSWER\n",
            ". [350, 662, 423, 676] -100\n",
            "qi [133, 824, 161, 837] O\n",
            "p [133, 824, 161, 837] -100\n",
            " [162, 824, 170, 838] O\n",
            ". [162, 824, 170, 838] -100\n",
            "wp [170, 823, 190, 837] O\n",
            "</s> [0, 0, 0, 0] -100\n"
          ]
        }
      ],
      "source": [
        "for id, box, label in zip(example[\"input_ids\"], example[\"bbox\"], example[\"labels\"]):\n",
        "  if label != -100:\n",
        "    print(tokenizer.decode([id]), box, id2label[label])\n",
        "  else:\n",
        "    print(tokenizer.decode([id]), box, -100)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "y9eDcNDX92_K"
      },
      "source": [
        "## Define PyTorch DataLoader"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 15,
      "metadata": {
        "id": "_wcV_X_X8var"
      },
      "outputs": [],
      "source": [
        "from torch.utils.data import DataLoader\n",
        "\n",
        "def collate_fn(features):\n",
        "  boxes = [feature[\"bbox\"] for feature in features]\n",
        "  labels = [feature[\"labels\"] for feature in features]\n",
        "  # use tokenizer to pad input_ids\n",
        "  batch = tokenizer.pad(features, padding=\"max_length\", max_length=512)\n",
        "\n",
        "  sequence_length = torch.tensor(batch[\"input_ids\"]).shape[1]\n",
        "  batch[\"labels\"] = [labels_example + [-100] * (sequence_length - len(labels_example)) for labels_example in labels]\n",
        "  batch[\"bbox\"] = [boxes_example + [[0, 0, 0, 0]] * (sequence_length - len(boxes_example)) for boxes_example in boxes]\n",
        "\n",
        "  # convert to PyTorch\n",
        "  # batch = {k: torch.tensor(v, dtype=torch.int64) if isinstance(v[0], list) else v for k, v in batch.items()}\n",
        "  batch = {k: torch.tensor(v) for k, v in batch.items()}\n",
        "\n",
        "  return batch\n",
        "\n",
        "train_dataloader = DataLoader(train_dataset, batch_size=2, shuffle=True, collate_fn=collate_fn)\n",
        "eval_dataloader = DataLoader(eval_dataset, batch_size=2, shuffle=False, collate_fn=collate_fn)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 16,
      "metadata": {
        "id": "RuvQ3Mdh-SCO",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "6648f61d-10b7-41d8-ad64-e373d6bdf432"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "You're using a XLMRobertaTokenizerFast tokenizer. Please note that with a fast tokenizer, using the `__call__` method is faster than using a method to encode the text followed by a call to the `pad` method to get a padded encoding.\n"
          ]
        }
      ],
      "source": [
        "batch = next(iter(train_dataloader))"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 17,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "8gvf2scF-Tk2",
        "outputId": "42391eb9-dc9c-463d-a2e5-4f7aca46e036"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "input_ids torch.Size([2, 512])\n",
            "attention_mask torch.Size([2, 512])\n",
            "bbox torch.Size([2, 512, 4])\n",
            "labels torch.Size([2, 512])\n"
          ]
        }
      ],
      "source": [
        "for k,v in batch.items():\n",
        "  print(k,v.shape)"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 18,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 143
        },
        "id": "HrUSyMnR_4Oz",
        "outputId": "179fd849-5730-4588-9db5-1ca30cad105a"
      },
      "outputs": [
        {
          "output_type": "execute_result",
          "data": {
            "text/plain": [
              "\"<s> Address City State Zip BRAND 1982 88057519 New SATIN 100's Direct Account Please Ship To Delivery Date No. OF CARTONS Satin Filter 100's Satin Menthol 100's Signature of Hetail Purchaser Order Taken By Sales Representative DIRECT ACCOUNT</s><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad><pad>\""
            ],
            "application/vnd.google.colaboratory.intrinsic+json": {
              "type": "string"
            }
          },
          "metadata": {},
          "execution_count": 18
        }
      ],
      "source": [
        "tokenizer.decode(batch[\"input_ids\"][0])"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 19,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "PtS3FUm_AJ-9",
        "outputId": "87ad7ae8-7a5f-4c45-8c22-b4dea188c127"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "<s> tensor([0, 0, 0, 0]) -100\n",
            "Address tensor([508, 483, 568, 496]) B-QUESTION\n",
            "City tensor([510, 507, 539, 518]) B-QUESTION\n",
            "State tensor([508, 529, 548, 540]) B-QUESTION\n",
            "Zip tensor([846, 528, 870, 542]) B-QUESTION\n",
            "BR tensor([796, 584, 877, 598]) B-QUESTION\n",
            "AND tensor([796, 584, 877, 598]) -100\n",
            "1982 tensor([911, 409, 942, 422]) O\n",
            "8 tensor([902, 747, 925, 832]) O\n",
            "805 tensor([902, 747, 925, 832]) -100\n",
            "75 tensor([902, 747, 925, 832]) -100\n",
            "19 tensor([902, 747, 925, 832]) -100\n",
            "New tensor([764, 270, 879, 304]) B-HEADER\n",
            "SA tensor([710, 306, 868, 351]) I-HEADER\n",
            "TIN tensor([710, 306, 868, 351]) -100\n",
            "100 tensor([871, 313, 939, 348]) I-HEADER\n",
            "' tensor([871, 313, 939, 348]) -100\n",
            "s tensor([871, 313, 939, 348]) -100\n",
            "Direct tensor([510, 436, 552, 447]) B-QUESTION\n",
            "Account tensor([552, 434, 612, 447]) I-QUESTION\n",
            "Please tensor([508, 458, 561, 472]) B-QUESTION\n",
            "Shi tensor([562, 455, 590, 472]) I-QUESTION\n",
            "p tensor([562, 455, 590, 472]) -100\n",
            "To tensor([594, 459, 613, 470]) I-QUESTION\n",
            "Delivery tensor([507, 554, 567, 568]) B-QUESTION\n",
            "Date tensor([567, 556, 603, 567]) I-QUESTION\n",
            "No tensor([528, 584, 564, 599]) B-QUESTION\n",
            ". tensor([528, 584, 564, 599]) -100\n",
            "OF tensor([567, 582, 602, 599]) I-QUESTION\n",
            "CAR tensor([602, 584, 714, 599]) I-QUESTION\n",
            "TON tensor([602, 584, 714, 599]) -100\n",
            "S tensor([602, 584, 714, 599]) -100\n",
            "Sat tensor([738, 619, 787, 634]) B-ANSWER\n",
            "in tensor([738, 619, 787, 634]) -100\n",
            "Filter tensor([788, 619, 830, 634]) I-ANSWER\n",
            "100 tensor([832, 617, 877, 632]) I-ANSWER\n",
            "' tensor([832, 617, 877, 632]) -100\n",
            "s tensor([832, 617, 877, 632]) -100\n",
            "Sat tensor([738, 652, 787, 669]) B-ANSWER\n",
            "in tensor([738, 652, 787, 669]) -100\n",
            "Men tensor([785, 652, 857, 669]) I-ANSWER\n",
            "t tensor([785, 652, 857, 669]) -100\n",
            "hol tensor([785, 652, 857, 669]) -100\n",
            "100 tensor([861, 652, 904, 670]) I-ANSWER\n",
            "' tensor([861, 652, 904, 670]) -100\n",
            "s tensor([861, 652, 904, 670]) -100\n",
            "Sig tensor([510, 796, 568, 807]) B-QUESTION\n",
            "nature tensor([510, 796, 568, 807]) -100\n",
            "of tensor([567, 796, 585, 806]) I-QUESTION\n",
            "Het tensor([508, 809, 545, 816]) I-QUESTION\n",
            "ail tensor([508, 809, 545, 816]) -100\n",
            "Pur tensor([549, 806, 610, 816]) I-QUESTION\n",
            "chas tensor([549, 806, 610, 816]) -100\n",
            "er tensor([549, 806, 610, 816]) -100\n",
            "Order tensor([512, 830, 544, 843]) O\n",
            "Tak tensor([549, 830, 585, 841]) O\n",
            "en tensor([549, 830, 585, 841]) -100\n",
            "By tensor([588, 834, 604, 842]) O\n",
            "Sales tensor([512, 842, 546, 852]) O\n",
            "Representa tensor([546, 842, 634, 852]) O\n",
            "tive tensor([546, 842, 634, 852]) -100\n",
            "DIRECT tensor([666, 859, 727, 867]) O\n",
            "AC tensor([731, 858, 812, 866]) O\n",
            "CO tensor([731, 858, 812, 866]) -100\n",
            "UNT tensor([731, 858, 812, 866]) -100\n",
            "</s> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n",
            "<pad> tensor([0, 0, 0, 0]) -100\n"
          ]
        }
      ],
      "source": [
        "for id, box, label in zip(batch[\"input_ids\"][0], batch[\"bbox\"][0], batch[\"labels\"][0]):\n",
        "  if label.item() != -100:\n",
        "    print(tokenizer.decode([id]), box, id2label[label.item()])\n",
        "  else:\n",
        "    print(tokenizer.decode([id]), box, label.item())"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "u-O6CIP1AhE6"
      },
      "source": [
        "## Define model"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 20,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 137,
          "referenced_widgets": [
            "f22d29fe964b409fbbc3c28bb144ffe0",
            "a835d599558a4fedb53b808fe20263d5",
            "21396bd891f94910bc1688a7d405ecd5",
            "ab5049cab6884cbba4297f351541dccc",
            "2ca17788139b459c854da5dfce08bfa9",
            "3b719898c28940faa56ce9e346dda660",
            "47a78f30c9094b49996abb4c92a7cd00",
            "18fd6e7972994a79b627f76cb31282d3",
            "3a1b881e65ec47b08b85c0437d2d6724",
            "09504fd02214477ca6bf0d3c25148827",
            "0d0835892c544a86aade3c12a00cad1f",
            "cef7746871064d068f5da7fb9e3205d0",
            "8c26e8c602754b6d82f6b3a64c915e20",
            "968b15898ec44aa6b9870976405be7bc",
            "4b0617a57ec94c3eb69e183677bdc030",
            "b27bd6e3bfd94bdba426c7f622ca51cc",
            "4e8c2b61b2b24693a48bde72e8895700",
            "b9a751d8b82148d98eca5811efdb89e8",
            "ce89f5c382e04b4dac3a60de8e196505",
            "baade606d143400e8c7b1c1be69f1e53",
            "5ed219c7989b46b6a7d4a61f36edd5ca",
            "481a6f0057eb4e23835f5fd6609838b4"
          ]
        },
        "id": "D1bW1-ldAOHS",
        "outputId": "1e035746-a950-4c19-a283-f1794e3c529f"
      },
      "outputs": [
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Downloading:   0%|          | 0.00/774 [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "f22d29fe964b409fbbc3c28bb144ffe0"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "Downloading:   0%|          | 0.00/1.14G [00:00<?, ?B/s]"
            ],
            "application/vnd.jupyter.widget-view+json": {
              "version_major": 2,
              "version_minor": 0,
              "model_id": "cef7746871064d068f5da7fb9e3205d0"
            }
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "Some weights of LiltForTokenClassification were not initialized from the model checkpoint at nielsr/lilt-xlm-roberta-base and are newly initialized: ['classifier.bias', 'classifier.weight']\n",
            "You should probably TRAIN this model on a down-stream task to be able to use it for predictions and inference.\n"
          ]
        }
      ],
      "source": [
        "from transformers import LiltForTokenClassification\n",
        "\n",
        "model = LiltForTokenClassification.from_pretrained(\"nielsr/lilt-xlm-roberta-base\", id2label=id2label)"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "UXJY2HJWHAw6"
      },
      "source": [
        "## Train the model in native PyTorch\n",
        "\n",
        "Uncomment the code below if you want to train the model just in native PyTorch."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 21,
      "metadata": {
        "id": "sfYvjYPVHB3m"
      },
      "outputs": [],
      "source": [
        "# device = \"cuda\" if torch.cuda.is_available() else \"cpu\"\n",
        "# model.to(device)\n",
        "\n",
        "# optimizer = torch.optim.AdamW(model.parameters(), lr=5-5)\n",
        "\n",
        "# model.train()\n",
        "# for epoch in range(2):\n",
        "#   for batch in train_dataloader:\n",
        "#       # zero the parameter gradients\n",
        "#       optimizer.zero_grad()\n",
        "\n",
        "#       inputs = {k:v.to(device) for k,v in batch.items()}\n",
        "\n",
        "#       outputs = model(**inputs)\n",
        "\n",
        "#       loss = outputs.loss\n",
        "#       loss.backward()\n",
        "\n",
        "#       optimizer.step()"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "Rf0nvl72BQsj"
      },
      "source": [
        "## Train the model using 🤗 Trainer\n",
        "\n",
        "We first define a compute_metrics function as well as TrainingArguments."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 27,
      "metadata": {
        "id": "cOOB2b5HCfls"
      },
      "outputs": [],
      "source": [
        "import evaluate\n",
        "\n",
        "metric = evaluate.load(\"seqeval\")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 28,
      "metadata": {
        "id": "gLHg5-VYCfJ7"
      },
      "outputs": [],
      "source": [
        "import numpy as np\n",
        "from seqeval.metrics import classification_report\n",
        "\n",
        "return_entity_level_metrics = False\n",
        "\n",
        "def compute_metrics(p):\n",
        "    predictions, labels = p\n",
        "    predictions = np.argmax(predictions, axis=2)\n",
        "\n",
        "    # Remove ignored index (special tokens)\n",
        "    true_predictions = [\n",
        "        [label_list[p] for (p, l) in zip(prediction, label) if l != -100]\n",
        "        for prediction, label in zip(predictions, labels)\n",
        "    ]\n",
        "    true_labels = [\n",
        "        [label_list[l] for (p, l) in zip(prediction, label) if l != -100]\n",
        "        for prediction, label in zip(predictions, labels)\n",
        "    ]\n",
        "\n",
        "    results = metric.compute(predictions=true_predictions, references=true_labels)\n",
        "    if return_entity_level_metrics:\n",
        "        # Unpack nested dictionaries\n",
        "        final_results = {}\n",
        "        for key, value in results.items():\n",
        "            if isinstance(value, dict):\n",
        "                for n, v in value.items():\n",
        "                    final_results[f\"{key}_{n}\"] = v\n",
        "            else:\n",
        "                final_results[key] = value\n",
        "        return final_results\n",
        "    else:\n",
        "        return {\n",
        "            \"precision\": results[\"overall_precision\"],\n",
        "            \"recall\": results[\"overall_recall\"],\n",
        "            \"f1\": results[\"overall_f1\"],\n",
        "            \"accuracy\": results[\"overall_accuracy\"],\n",
        "        }"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 33,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "uXIqK1I7BQD2",
        "outputId": "abb4a53c-24fa-4f27-d58c-6cbb38d3f58d"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "PyTorch: setting up devices\n",
            "The default value for the training argument `--report_to` will change in v5 (from all installed integrations to none). In v5, you will need to use `--report_to all` to get the same behavior as now. You should start updating your code and make this info disappear :-).\n"
          ]
        }
      ],
      "source": [
        "from transformers import TrainingArguments, Trainer\n",
        "\n",
        "training_args = TrainingArguments(output_dir=\"test\",\n",
        "                                  num_train_epochs=30,\n",
        "                                  learning_rate=5e-5,\n",
        "                                  evaluation_strategy=\"steps\",\n",
        "                                  eval_steps=100,\n",
        "                                  load_best_model_at_end=True,\n",
        "                                  metric_for_best_model=\"f1\")"
      ]
    },
    {
      "cell_type": "markdown",
      "metadata": {
        "id": "8zQveC41Jo_E"
      },
      "source": [
        "Next we define a custom Trainer which uses the DataLoaders we created above."
      ]
    },
    {
      "cell_type": "code",
      "execution_count": 34,
      "metadata": {
        "id": "FWciWA4LBtrx"
      },
      "outputs": [],
      "source": [
        "from transformers.data.data_collator import default_data_collator\n",
        "\n",
        "class CustomTrainer(Trainer):\n",
        "  def get_train_dataloader(self):\n",
        "    return train_dataloader\n",
        "\n",
        "  def get_eval_dataloader(self, eval_dataset = None):\n",
        "    return eval_dataloader\n",
        "\n",
        "# Initialize our Trainer\n",
        "trainer = CustomTrainer(\n",
        "    model=model,\n",
        "    args=training_args,\n",
        "    train_dataset=train_dataset,\n",
        "    eval_dataset=eval_dataset,\n",
        "    tokenizer=tokenizer,\n",
        "    compute_metrics=compute_metrics,\n",
        ")"
      ]
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/",
          "height": 1000
        },
        "id": "rQup1rSjC5Vj",
        "outputId": "1b1e12ad-0e1d-40e3-d918-3d6c2bc2af67"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "/usr/local/lib/python3.7/dist-packages/transformers/optimization.py:310: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning\n",
            "  FutureWarning,\n",
            "***** Running training *****\n",
            "  Num examples = 149\n",
            "  Num Epochs = 30\n",
            "  Instantaneous batch size per device = 8\n",
            "  Total train batch size (w. parallel, distributed & accumulation) = 8\n",
            "  Gradient Accumulation steps = 1\n",
            "  Total optimization steps = 2250\n",
            "  Number of trainable parameters = 283567815\n"
          ]
        },
        {
          "output_type": "display_data",
          "data": {
            "text/plain": [
              "<IPython.core.display.HTML object>"
            ],
            "text/html": [
              "\n",
              "    <div>\n",
              "      \n",
              "      <progress value='1501' max='2250' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
              "      [1501/2250 11:58 < 05:58, 2.09 it/s, Epoch 20/30]\n",
              "    </div>\n",
              "    <table border=\"1\" class=\"dataframe\">\n",
              "  <thead>\n",
              " <tr style=\"text-align: left;\">\n",
              "      <th>Step</th>\n",
              "      <th>Training Loss</th>\n",
              "      <th>Validation Loss</th>\n",
              "      <th>Precision</th>\n",
              "      <th>Recall</th>\n",
              "      <th>F1</th>\n",
              "      <th>Accuracy</th>\n",
              "    </tr>\n",
              "  </thead>\n",
              "  <tbody>\n",
              "    <tr>\n",
              "      <td>100</td>\n",
              "      <td>No log</td>\n",
              "      <td>1.368461</td>\n",
              "      <td>0.629163</td>\n",
              "      <td>0.712175</td>\n",
              "      <td>0.668100</td>\n",
              "      <td>0.741463</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>200</td>\n",
              "      <td>No log</td>\n",
              "      <td>1.497292</td>\n",
              "      <td>0.684980</td>\n",
              "      <td>0.692308</td>\n",
              "      <td>0.688624</td>\n",
              "      <td>0.719545</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>300</td>\n",
              "      <td>No log</td>\n",
              "      <td>1.585323</td>\n",
              "      <td>0.684028</td>\n",
              "      <td>0.702496</td>\n",
              "      <td>0.693139</td>\n",
              "      <td>0.726447</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>400</td>\n",
              "      <td>No log</td>\n",
              "      <td>1.692035</td>\n",
              "      <td>0.657696</td>\n",
              "      <td>0.709628</td>\n",
              "      <td>0.682676</td>\n",
              "      <td>0.734682</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>500</td>\n",
              "      <td>0.149500</td>\n",
              "      <td>1.637528</td>\n",
              "      <td>0.689837</td>\n",
              "      <td>0.733062</td>\n",
              "      <td>0.710793</td>\n",
              "      <td>0.740131</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>600</td>\n",
              "      <td>0.149500</td>\n",
              "      <td>1.672109</td>\n",
              "      <td>0.675588</td>\n",
              "      <td>0.745797</td>\n",
              "      <td>0.708959</td>\n",
              "      <td>0.715549</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>700</td>\n",
              "      <td>0.149500</td>\n",
              "      <td>1.877164</td>\n",
              "      <td>0.683581</td>\n",
              "      <td>0.727458</td>\n",
              "      <td>0.704837</td>\n",
              "      <td>0.740857</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>800</td>\n",
              "      <td>0.149500</td>\n",
              "      <td>2.084933</td>\n",
              "      <td>0.659132</td>\n",
              "      <td>0.742741</td>\n",
              "      <td>0.698443</td>\n",
              "      <td>0.724994</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>900</td>\n",
              "      <td>0.149500</td>\n",
              "      <td>2.121748</td>\n",
              "      <td>0.731194</td>\n",
              "      <td>0.708100</td>\n",
              "      <td>0.719462</td>\n",
              "      <td>0.740373</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1000</td>\n",
              "      <td>0.047300</td>\n",
              "      <td>2.140170</td>\n",
              "      <td>0.683736</td>\n",
              "      <td>0.734590</td>\n",
              "      <td>0.708251</td>\n",
              "      <td>0.734197</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1100</td>\n",
              "      <td>0.047300</td>\n",
              "      <td>2.259392</td>\n",
              "      <td>0.720040</td>\n",
              "      <td>0.728477</td>\n",
              "      <td>0.724234</td>\n",
              "      <td>0.737103</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1200</td>\n",
              "      <td>0.047300</td>\n",
              "      <td>2.245098</td>\n",
              "      <td>0.711639</td>\n",
              "      <td>0.763118</td>\n",
              "      <td>0.736480</td>\n",
              "      <td>0.759627</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1300</td>\n",
              "      <td>0.047300</td>\n",
              "      <td>2.306031</td>\n",
              "      <td>0.733602</td>\n",
              "      <td>0.740703</td>\n",
              "      <td>0.737136</td>\n",
              "      <td>0.740373</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1400</td>\n",
              "      <td>0.047300</td>\n",
              "      <td>2.365533</td>\n",
              "      <td>0.717231</td>\n",
              "      <td>0.744269</td>\n",
              "      <td>0.730500</td>\n",
              "      <td>0.737709</td>\n",
              "    </tr>\n",
              "    <tr>\n",
              "      <td>1500</td>\n",
              "      <td>0.013400</td>\n",
              "      <td>2.297272</td>\n",
              "      <td>0.729229</td>\n",
              "      <td>0.742231</td>\n",
              "      <td>0.735673</td>\n",
              "      <td>0.747396</td>\n",
              "    </tr>\n",
              "  </tbody>\n",
              "</table><p>"
            ]
          },
          "metadata": {}
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "Saving model checkpoint to test/checkpoint-500\n",
            "Configuration saved in test/checkpoint-500/config.json\n",
            "Model weights saved in test/checkpoint-500/pytorch_model.bin\n",
            "tokenizer config file saved in test/checkpoint-500/tokenizer_config.json\n",
            "Special tokens file saved in test/checkpoint-500/special_tokens_map.json\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "Saving model checkpoint to test/checkpoint-1000\n",
            "Configuration saved in test/checkpoint-1000/config.json\n",
            "Model weights saved in test/checkpoint-1000/pytorch_model.bin\n",
            "tokenizer config file saved in test/checkpoint-1000/tokenizer_config.json\n",
            "Special tokens file saved in test/checkpoint-1000/special_tokens_map.json\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "***** Running Evaluation *****\n",
            "  Num examples = 50\n",
            "  Batch size = 8\n",
            "Saving model checkpoint to test/checkpoint-1500\n",
            "Configuration saved in test/checkpoint-1500/config.json\n",
            "Model weights saved in test/checkpoint-1500/pytorch_model.bin\n"
          ]
        }
      ],
      "source": [
        "trainer.train()"
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Inference\n",
        "\n",
        "For inference I refer to my LayoutLM notebooks, as it would be equivalent."
      ],
      "metadata": {
        "id": "7GYz14mjI30i"
      }
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "6WOTs-JOC5_e"
      },
      "outputs": [],
      "source": []
    }
  ]
}